#!/usr/bin/env python
#coding=utf-8
"""
socket client ex1
"""
import socket, time

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = '127.0.0.1'
port = 52333
s.connect((host, port))

init_str = raw_input("input: ")
while 1:
	s.sendall(init_str)
	print 'send', init_str

	data = s.recv(1024)
	print 'recv', data
	time.sleep(2)

s.close()